/*
 * @Descripttion: 
 * @version: 
 * @Author: 尹伊
 * @Date: 2020-05-28 15:53:08
 * @LastEditors: 尹伊
 * @LastEditTime: 2020-12-29 15:45:47
 */
export default {
  mode: 'universal',
  /*
   ** Headers of the page
   */
  head: {
    title: process.env.npm_package_name || '',
    meta: [{
        charset: 'utf-8'
      },
      {
        name: 'viewport',
        content: 'width=device-width, initial-scale=1'
      },
      {
        hid: 'description',
        name: 'description',
        content: process.env.npm_package_description || ''
      }
    ],
    link: [{
      rel: 'icon',
      type: 'image/x-icon',
      href: '/favicon.ico'
    }]
  },
  /*
   ** Customize the progress-bar color
   */
  loading: {
    color: '#fff'
  },
  /*
   ** Global CSS
   */
  css: [
    'element-ui/lib/theme-chalk/index.css',
    '@/assets/main.scss'
  ],
  /*
   ** Plugins to load before mounting the App
   */
  plugins: [{
      src: '@/plugins/element-ui',
      ssr: true
    },
    // {
    //   src: '@/plugins/lineHeart',
    //   ssr: false
    // },
    {
      src: '@/plugins/VueAnimateNumber',
      ssr: false
    },
    // {
    //   src: '@/plugins/dragpanel',
    //   ssr: false
    // }
  ],
  /*
   ** Nuxt.js dev-modules
   */
  buildModules: [],
  /*
   ** Nuxt.js modules
   */
  modules: [
    '@nuxtjs/axios',
    	'@nuxtjs/proxy',
  ],
  axios: {
    proxy: true, // 表示开启代理
    prefix: '/api', // 表示给请求url加个前缀 /api
    withCredentials: true // 表示跨域请求时是否需要使用凭证
  },
  proxy: {
    '/api': {
        target: 'http://172.20.10.2:8080/', // 目标接口域名
        changeOrigin: true, // 表示是否跨域
        pathRewrite: {
          '^/api': '', // 把 /api 替换成‘’
        }
    }
  },

  /*
   ** Build configuration
   */
  build: {
    transpile: [/^element-ui/],
    /*
     ** You can extend webpack config here
     */
    extend(config, ctx) {}
  }
}
